#include <iostream>



template <typename T>
struct BaseItr{
    virtual T  next()=0;
};

template <typename T>
struct Iter:public BaseItr<T>{
    Iter(int lens, T *p):len(lens),data(p){

    }

    T next(){
        --len;
        return *data++;
    }
    T *data;
    int len;
};

int main(){
    int d = 1;
    Iter<int> instance(2, &d);
    return 0;
}
